﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IsmlTools.Common
{
    public class RegHelper
    {
        public string GetMidPattern(string begin, string end) 
        {
            return @"(?<=" + begin + @")[.\s\S]*?(?=" + end +  ")";
        }
    }

    public class LanguageCode
    {
        public const string Sc = "zh-CN";
        public const string Tc = "zh-TW";
        public const string En = "en";
        public const string Ru = "ru";
        public const string Kr = "ko";
        public const string Jp = "ja";
        public static readonly string[] AllLanguage = { Sc, Tc, En, Ru, Kr, Jp };

    }

    public class WebPageLink
    {

        // 2012
        
        public const string NamesSeason2012 = @"http://2012.internationalsaimoe.com/files/names_season.js";
        public const string PreliminaryPhaseI2012 = @"http://2012.internationalsaimoe.com/statistics/preliminary/phase1.php";
        public const string PreliminaryPhaseIi2012 = @"http://2012.internationalsaimoe.com/statistics/preliminary/phase2.php";

        // 2013
        public const string NamesSeason2013 = @"http://www.internationalsaimoe.com/files/names_season.js";
        public const string PreliminaryPhaseI2013 = @"http://www.internationalsaimoe.com/statistics/preliminary/phase1.php";
        public const string PreliminaryPhaseIi2013 = @"http://www.internationalsaimoe.com/statistics/preliminary/phase2.php";
        
    }

    public class CalendarHelper
    {
        // 2012
        public static readonly DateTime PreliminaryPhaseIDate2012 = new DateTime(2012, 2, 12);

        public static DateTime GetNextDate(DateTime dateTime)
        {

            if (dateTime.DayOfWeek == DayOfWeek.Thursday)
                return dateTime.AddDays(3);
            else
                return dateTime.AddDays(2);

        }
    }
}
